{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn.decomposition import PCA\n",
    "from sklearn.cluster import KMeans\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.metrics import silhouette_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "# 读取四张表的数据\n",
    "prior = pd.read_csv(\"./data/instacart/order_products__prior.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "products = pd.read_csv(\"./data/instacart/products.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "orders = pd.read_csv(\"./data/instacart/orders.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "aisles = pd.read_csv(\"./data/instacart/aisles.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 合并四张表到一张表  （用户-物品类别）\n",
    "_mg = pd.merge(prior, products, on=['product_id', 'product_id'])\n",
    "_mg = pd.merge(_mg, orders, on=['order_id', 'order_id'])\n",
    "mt = pd.merge(_mg, aisles, on=['aisle_id', 'aisle_id'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>product_id</th>\n",
       "      <th>add_to_cart_order</th>\n",
       "      <th>reordered</th>\n",
       "      <th>product_name</th>\n",
       "      <th>aisle_id</th>\n",
       "      <th>department_id</th>\n",
       "      <th>user_id</th>\n",
       "      <th>eval_set</th>\n",
       "      <th>order_number</th>\n",
       "      <th>order_dow</th>\n",
       "      <th>order_hour_of_day</th>\n",
       "      <th>days_since_prior_order</th>\n",
       "      <th>aisle</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>33120</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>26</td>\n",
       "      <td>33120</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>153404</td>\n",
       "      <td>prior</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>16</td>\n",
       "      <td>7.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>120</td>\n",
       "      <td>33120</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>23750</td>\n",
       "      <td>prior</td>\n",
       "      <td>11</td>\n",
       "      <td>6</td>\n",
       "      <td>8</td>\n",
       "      <td>10.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>327</td>\n",
       "      <td>33120</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>58707</td>\n",
       "      <td>prior</td>\n",
       "      <td>21</td>\n",
       "      <td>6</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>390</td>\n",
       "      <td>33120</td>\n",
       "      <td>28</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>166654</td>\n",
       "      <td>prior</td>\n",
       "      <td>48</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>9.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>537</td>\n",
       "      <td>33120</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>180135</td>\n",
       "      <td>prior</td>\n",
       "      <td>15</td>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "      <td>3.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>582</td>\n",
       "      <td>33120</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>193223</td>\n",
       "      <td>prior</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>19</td>\n",
       "      <td>10.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>608</td>\n",
       "      <td>33120</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>91030</td>\n",
       "      <td>prior</td>\n",
       "      <td>11</td>\n",
       "      <td>3</td>\n",
       "      <td>21</td>\n",
       "      <td>12.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>623</td>\n",
       "      <td>33120</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>37804</td>\n",
       "      <td>prior</td>\n",
       "      <td>63</td>\n",
       "      <td>3</td>\n",
       "      <td>12</td>\n",
       "      <td>3.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>689</td>\n",
       "      <td>33120</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>108932</td>\n",
       "      <td>prior</td>\n",
       "      <td>16</td>\n",
       "      <td>1</td>\n",
       "      <td>13</td>\n",
       "      <td>3.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   order_id  product_id  add_to_cart_order  reordered        product_name  \\\n",
       "0         2       33120                  1          1  Organic Egg Whites   \n",
       "1        26       33120                  5          0  Organic Egg Whites   \n",
       "2       120       33120                 13          0  Organic Egg Whites   \n",
       "3       327       33120                  5          1  Organic Egg Whites   \n",
       "4       390       33120                 28          1  Organic Egg Whites   \n",
       "5       537       33120                  2          1  Organic Egg Whites   \n",
       "6       582       33120                  7          1  Organic Egg Whites   \n",
       "7       608       33120                  5          1  Organic Egg Whites   \n",
       "8       623       33120                  1          1  Organic Egg Whites   \n",
       "9       689       33120                  4          1  Organic Egg Whites   \n",
       "\n",
       "   aisle_id  department_id  user_id eval_set  order_number  order_dow  \\\n",
       "0        86             16   202279    prior             3          5   \n",
       "1        86             16   153404    prior             2          0   \n",
       "2        86             16    23750    prior            11          6   \n",
       "3        86             16    58707    prior            21          6   \n",
       "4        86             16   166654    prior            48          0   \n",
       "5        86             16   180135    prior            15          2   \n",
       "6        86             16   193223    prior             6          2   \n",
       "7        86             16    91030    prior            11          3   \n",
       "8        86             16    37804    prior            63          3   \n",
       "9        86             16   108932    prior            16          1   \n",
       "\n",
       "   order_hour_of_day  days_since_prior_order aisle  \n",
       "0                  9                     8.0  eggs  \n",
       "1                 16                     7.0  eggs  \n",
       "2                  8                    10.0  eggs  \n",
       "3                  9                     8.0  eggs  \n",
       "4                 12                     9.0  eggs  \n",
       "5                  8                     3.0  eggs  \n",
       "6                 19                    10.0  eggs  \n",
       "7                 21                    12.0  eggs  \n",
       "8                 12                     3.0  eggs  \n",
       "9                 13                     3.0  eggs  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mt.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 交叉表（特殊的分组工具）\n",
    "cross = pd.crosstab(mt['user_id'], mt['aisle'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>aisle</th>\n",
       "      <th>air fresheners candles</th>\n",
       "      <th>asian foods</th>\n",
       "      <th>baby accessories</th>\n",
       "      <th>baby bath body care</th>\n",
       "      <th>baby food formula</th>\n",
       "      <th>bakery desserts</th>\n",
       "      <th>baking ingredients</th>\n",
       "      <th>baking supplies decor</th>\n",
       "      <th>beauty</th>\n",
       "      <th>beers coolers</th>\n",
       "      <th>...</th>\n",
       "      <th>spreads</th>\n",
       "      <th>tea</th>\n",
       "      <th>tofu meat alternatives</th>\n",
       "      <th>tortillas flat bread</th>\n",
       "      <th>trail mix snack mix</th>\n",
       "      <th>trash bags liners</th>\n",
       "      <th>vitamins supplements</th>\n",
       "      <th>water seltzer sparkling water</th>\n",
       "      <th>white wines</th>\n",
       "      <th>yogurt</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>user_id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 134 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "aisle    air fresheners candles  asian foods  baby accessories  \\\n",
       "user_id                                                          \n",
       "1                             0            0                 0   \n",
       "2                             0            3                 0   \n",
       "3                             0            0                 0   \n",
       "4                             0            0                 0   \n",
       "5                             0            2                 0   \n",
       "6                             0            0                 0   \n",
       "7                             0            0                 0   \n",
       "8                             0            1                 0   \n",
       "9                             0            0                 0   \n",
       "10                            0            1                 0   \n",
       "\n",
       "aisle    baby bath body care  baby food formula  bakery desserts  \\\n",
       "user_id                                                            \n",
       "1                          0                  0                0   \n",
       "2                          0                  0                0   \n",
       "3                          0                  0                0   \n",
       "4                          0                  0                0   \n",
       "5                          0                  0                0   \n",
       "6                          0                  0                0   \n",
       "7                          0                  0                0   \n",
       "8                          0                  0                0   \n",
       "9                          0                  6                0   \n",
       "10                         0                  0                0   \n",
       "\n",
       "aisle    baking ingredients  baking supplies decor  beauty  beers coolers  \\\n",
       "user_id                                                                     \n",
       "1                         0                      0       0              0   \n",
       "2                         2                      0       0              0   \n",
       "3                         0                      0       0              0   \n",
       "4                         0                      0       0              0   \n",
       "5                         0                      0       0              0   \n",
       "6                         0                      0       0              0   \n",
       "7                         2                      0       0              0   \n",
       "8                         1                      0       0              0   \n",
       "9                         2                      0       0              0   \n",
       "10                        0                      0       0              0   \n",
       "\n",
       "aisle    ...  spreads  tea  tofu meat alternatives  tortillas flat bread  \\\n",
       "user_id  ...                                                               \n",
       "1        ...        1    0                       0                     0   \n",
       "2        ...        3    1                       1                     0   \n",
       "3        ...        4    1                       0                     0   \n",
       "4        ...        0    0                       0                     1   \n",
       "5        ...        0    0                       0                     0   \n",
       "6        ...        0    0                       0                     0   \n",
       "7        ...        0    0                       0                     0   \n",
       "8        ...        0    0                       0                     0   \n",
       "9        ...        0    0                       0                     0   \n",
       "10       ...        0    0                       0                     0   \n",
       "\n",
       "aisle    trail mix snack mix  trash bags liners  vitamins supplements  \\\n",
       "user_id                                                                 \n",
       "1                          0                  0                     0   \n",
       "2                          0                  0                     0   \n",
       "3                          0                  0                     0   \n",
       "4                          0                  0                     0   \n",
       "5                          0                  0                     0   \n",
       "6                          0                  0                     0   \n",
       "7                          0                  0                     0   \n",
       "8                          0                  0                     0   \n",
       "9                          0                  0                     0   \n",
       "10                         0                  0                     0   \n",
       "\n",
       "aisle    water seltzer sparkling water  white wines  yogurt  \n",
       "user_id                                                      \n",
       "1                                    0            0       1  \n",
       "2                                    2            0      42  \n",
       "3                                    2            0       0  \n",
       "4                                    1            0       0  \n",
       "5                                    0            0       3  \n",
       "6                                    0            0       0  \n",
       "7                                    0            0       5  \n",
       "8                                    0            0       0  \n",
       "9                                    2            0      19  \n",
       "10                                   0            0       2  \n",
       "\n",
       "[10 rows x 134 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cross.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PCA(n_components=0.9)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 进行主成分分析,那么大家还记得不？\n",
    "pca = PCA(n_components=0.9)\n",
    "pca"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-2.42156587e+01,  2.42942720e+00, -2.46636975e+00, ...,\n",
       "         6.86800336e-01,  1.69439402e+00, -2.34323022e+00],\n",
       "       [ 6.46320806e+00,  3.67511165e+01,  8.38255336e+00, ...,\n",
       "         4.12121252e+00,  2.44689740e+00, -4.28348478e+00],\n",
       "       [-7.99030162e+00,  2.40438257e+00, -1.10300641e+01, ...,\n",
       "         1.77534453e+00, -4.44194030e-01,  7.86665571e-01],\n",
       "       ...,\n",
       "       [ 8.61143331e+00,  7.70129866e+00,  7.95240226e+00, ...,\n",
       "        -2.74252456e+00,  1.07112531e+00, -6.31925661e-02],\n",
       "       [ 8.40862199e+01,  2.04187340e+01,  8.05410372e+00, ...,\n",
       "         7.27554259e-01,  3.51339470e+00, -1.79079914e+01],\n",
       "       [-1.39534562e+01,  6.64621821e+00, -5.23030367e+00, ...,\n",
       "         8.25329076e-01,  1.38230701e+00, -2.41942061e+00]])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pca.fit_transform(cross)  #还记得fit_transform的作用不？\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(500, 27)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 把样本数量减少\n",
    "x = data[:500]\n",
    "x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 假设用户一共分为四个类别\n",
    "km = KMeans(n_clusters=4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "KMeans(n_clusters=4)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "km.fit(x)  #开始训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "#开始预测\n",
    "predict = km.predict(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,\n",
       "       0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,\n",
       "       3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 2, 3, 0,\n",
       "       0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,\n",
       "       0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,\n",
       "       0, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 3, 3, 3, 0, 3, 0, 0, 0, 0, 0, 0,\n",
       "       3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 3, 0, 0, 0, 0, 0,\n",
       "       0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 3, 0, 0, 0,\n",
       "       0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,\n",
       "       0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0,\n",
       "       0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 3, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 2,\n",
       "       0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,\n",
       "       0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "predict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 720x720 with 0 Axes>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 720x720 with 0 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 显示聚类的结果\n",
    "plt.figure(figsize=(10,10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x261000a9668>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAD4CAYAAAAJmJb0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR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jC1QDEGNrarx+RE1587f0wLEEPRzd6bASuIEXgX+7Cvrz8BzGB/oIYunmqIljtIGaK0PKqXqA/OVUlsiHE9VRcu5DPp7LuJJXms9pLL9SqnbgdHAFb6v6mitHYDDd3ulUmoH0A7j0610k04mcDCcsfliaOonhqDGVpX4AjwnKs5dAGE7d6dVNU6l1H+AL313A8UZbtESxxla64O+30eVUjMxmhSOKKUaaa0P+ZrejkYwxECxRMW51FofOX07WO+5qG6uUUqNAB4FrtZaF5XanqGUMvtutwLaAjt9X79OKaX6+Xpf3AYEqjWGJDbgc2CcUsqulGrpi21ZOGM7R9wRP3eViKpz50sCp10LnO4F4TfOUMfjx3KgrVKqpVLKBozzxRYRSqlEpVTy6dsYnRM2+GK63few24nA+76UQLFExd80JO+5UF49DsLV52yMdqg1vp/XfNuvBzZiXG1eBVxV6jlZvhOzA3gJ36jecMXm2/eEr/ytlOoFEq7YfGVdi/Hp7wCOAPOi6Nz5jS1azl2pMt8F1gPrfP9kjc4VZ7h/gFHANl8sT0QqDl8srXzvq7W+99gTvu31gK+B7b7fdcMUzwcYzZMu3/ttYmWxhPtvGiC+oL/nZFoDIYSIYVHdXCOEEKJmJMkLIUQMkyQvhBAxTJK8EELEMEnyQggRwyTJCyFEDJMkL4QQMez/AbUctuUWdF8aAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 建立四个颜色的列表\n",
    "colored = ['orange', 'green', 'blue', 'purple']\n",
    "colr = [colored[i] for i in predict]\n",
    "plt.scatter(x[:, 1], x[:, 20], color=colr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, '20')"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUh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xbcy2q6r6qema4eT+D96NsReP8vQD4GPAV4MnNHG6TjbMWHwTurKrHAapqq67HOGtRwGuSBHg1g1Cc3dwx+6uqexn82c5loq+bsxqKc93aY73nbAXr/XN+hMF3DFvRmmuRZAfwfuDQJs41DeP8vXgj8Lok305yPMn1mzbd5hpnLT4HvJnBG3ofBj5eVS9szngzZaKvmz1v4fFybNjtP7aAsf+cSd7DIBS/13Wi6RlnLT4D3FxVzw++edyyxlmL7cBVwHuBXwW+m+T+qvpB7+E22Thr8T7gQeAPgN8GvpXkX6vqf3sPN2Mm+ro5q6Hw9h/LxvpzJnkLcDuwv6p+skmzbbZx1mIeODqMxMXANUnOVtVXN2fETTPuv5GnqupZ4Nkk9wJXAlstFOOsxQ3Ap2vwRP1ikh8CVwD/sTkjzoyJvm7O6lNP3v5j2ZprkeQy4E7gw1vwu8VRa65FVe2qqsur6nLgy8BfbsFIwHj/Rr4GvCvJ9iSvZHD35kc3ec7NMM5aPM7gyooklzC4k+rJTZ1yNkz0dXMmryiq3+0/zjtjrsUngIuAzw+/kz5bW/COmWOuxS+Fcdaiqh5NcjfwEPACcHtVbblb9I/59+JTwB1JHmbw9MvNVbXlbj+e5EvAXuDiJEvAJ4FXwMv7uuktPCRJTbP61JMkaUYYCklSk6GQJDUZCklSk6GQJDUZCmkDrHXXTul8ZiikjXEHsG/aQ0g9GAppA4xx107pvGUoJElNhkKS1GQoJElNhkKS1GQopA0wvGvnd4E3JVlK8pFpzyRtFO8eK0lq8opCktRkKCRJTYZCktRkKCRJTYZCktRkKCRJTYZCktT0/39yCKJgaFwyAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.xlabel(\"1\")\n",
    "plt.ylabel(\"20\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6091068899459945"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 评判聚类效果，轮廓系数，聚类效果很难超过0.7，可以通过这个得分去调整上面KMeans的n_clusters\n",
    "silhouette_score(x, predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
